"""mytest URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from rest_framework.authtoken import views as authtoken

from rest_framework_jwt.views import obtain_jwt_token,refresh_jwt_token
from . import views
from . import utils
from .views import SmsCodeViewset
from rest_framework.routers import DefaultRouter
from .views import LoginViewSet, SmsCodeViewset
from rest_framework.urlpatterns import format_suffix_patterns


user_login = LoginViewSet.as_view({
    'post':'login_by_phone',
})
sms = SmsCodeViewset.as_view({
    'post':'create',
})
# 配置codes的url
# router = DefaultRouter()
# router.register('code', SmsCodeViewset, basename="code")

urlpatterns = format_suffix_patterns([
    path('sms/', sms, name='sms'),
    path('user_login/', user_login, name='user_login'),
    path('myshow/',views.MyView.as_view())
])
# urlpatterns = [
#     # path('login/',obtain_jwt_token),
#     # path('refresh_jwt_token/',refresh_jwt_token),
#     # 获取
#     path('login/', utils.obtain_jwt_token),
#     path('login_msg/', utils.verify_jwt_token),
#     path('api-token-auth/', authtoken.obtain_auth_token),

#     # 刷新
#     path('refresh_jwt_token/', utils.refresh_jwt_token),
#     path('myshow/',views.MyView.as_view()),
#     path('yourshow/',views.YourView.as_view()),
#     path('myJwt/',views.MyJwtAuthenticationView.as_view()),

# ]